<template>
  <div class="article-item">
    <van-cell :title="article.title" size="large" :to="'/article/' +article.art_id">
      <div slot="label" class="custom-label">
        <div v-if="article.cover.type === 3" class="cover-images">
          <van-image v-for="(item,ind) in article.cover.images" :key="ind" fit="cover" :src="item" />
        </div>
        <span>{{article.aut_name}}</span>
        <span class="common">{{article.comm_count}}评论</span>
        <span>{{article.pubdate | formatData}}</span>
      </div>
      <!-- 自定义右侧内容区域 -->
      <van-image v-if="article.cover.type === 1" class="right-image" fit="cover" :src="article.cover.images[0]" />
    </van-cell>
  </div>
</template>

<script>
export default {
  name: 'articalItem',
  data () {
    return {}
  },
  props: {
    article: {
      type: Object,
      required: true
    }
  },
  methods: {},
  computed: {},
  watch: {},
  filters: {},
  components: {},
  created () { },
  mounted () { }
}
</script>

<style scoped lang='less'>
.article-item {
  .van-cell__title,
  .van-cell__value {
    flex: unset;
  }
  .custom-label {
    font-size: 23px;
    color: #999;
    .common {
      margin: 24px 10px;
    }
  }
  .cover-images {
    display: flex;
    margin: 30px 0;
    .van-image {
      width: 232px;
      height: 146px;
    }
    .van-image:nth-child(2) {
      margin: 0 3px;
    }
  }
}
.right-image {
  width: 232px;
  height: 146px;
}
</style>
